//
//  MyPatientListCell.m
//  StraightTrain
//
//  Created by mk on 15/11/27.
//  Copyright © 2015年 mk. All rights reserved.
//

#import "MyPatientListCell.h"

@implementation MyPatientListCell

- (void)awakeFromNib
{
    // Initialization code
    
    for (NSLayoutConstraint * containt in [lanDiseaseName constraints])
    {
        if (containt.firstItem == lanDiseaseName && containt.firstAttribute == NSLayoutAttributeWidth)
        {
            containt.constant = APP_CONTENT_WIDTH-26;
        }
    }
    
}


-(void)fillDateWith:(PatienUserInfoData*)info isDelete:(BOOL)deleteOn
{
    labName.text = [NSString stringWithFormat:@"患者姓名:%@",info.patien_name];
    labMess.text = [NSString stringWithFormat:@"%@ | %@岁 | %@",info.patien_gender,info.patien_age,info.patien_cityName];
    lanDiseaseName.text = [NSString stringWithFormat:@"疾病名称:%@",info.patien_diseaseName];
    
    btnDelete.hidden = !deleteOn;

}

-(IBAction)btnClickDelete:(id)sender
{
    if ([self.delegate respondsToSelector:@selector(delegatePatientWith:)])
    {
        [self.delegate delegatePatientWith:self];
    }

}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
